package com.gxuwz.PangGuangyao.business.dao;

import org.hibernate.Hibernate;
import org.springframework.stereotype.Repository;

import com.gxuwz.PangGuangyao.business.entity.ExpeCata;
import com.gxuwz.core.dao.impl.BaseDaoImpl;
import com.gxuwz.core.pagination.Result;

@Repository("expeCataDAO")
public class ExpeCataDAO extends BaseDaoImpl<ExpeCata>{
	
	/**
	 * 根据条件查找分页
	 * @param ExpeCata 模型
	 * @param page 第几页
	 * @param row 长度
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public Result<ExpeCata> find(ExpeCata ExpeCata, int page, int row){
		String hql="from ExpeCata  where 1=1";
		/*if(null != sysRight.getRightName()){
			queryString = queryString + " and rightName like '%"+sysRight.getRightName()+"%'";
		}*/
		int start=(page-1)*row;
		int limit =row;
		return (Result<ExpeCata>)super.find(hql, null, null, start, limit);
	}
	/**
	 * @return
	 * @author lw
	 * @date 2020.02.20
	 * @description:添加目录列表
	 */
	public void add (ExpeCata expeCata)
	{
		save(expeCata);
		}
	/**
	 * @return
	 * @author lw
	 * @date 2020.02.25
	 * @description:删除目录列表
	 */
public void delete(ExpeCata expeCata){
	remove(expeCata);
}
/**
 * @return
 * @author lw
 * @date 2020.02.25
 * @description:通过ecId查询实体
 */
public ExpeCata findByecId(String ecId)
{
	String hql="from ExpeCata where ecId='"+ecId+"'";
	return findByHql(hql);
}
}
